package com.first.nell.network

import com.first.nell.data.*
import com.first.nell.utils.AppConfigUtil
import kotlinx.coroutines.*

object ApiToolReposity : ApiBaseReposity() {
    val mFirstNellJob = Job()
    val mFirstNellScope = CoroutineScope(mFirstNellJob)

    fun fetchFirstNellAppFirstNellConfig(reqBase: ReqBase) {
        mFirstNellScope.launch {
            try {
                val response =
                    ApiToolNetwork.fetchFirstNellAppFirstNellConfig(reqBase)
                if (response.code.equals("0000", true)) {
                    val obj = response.obj
                    AppConfigUtil.mFirstNellSysFirstNellConfig = obj
                }
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }
    }

}